#include <iostream>
#include <cassert>
#include <sstream>
#include <string>
using namespace std;

#define cv(i, j) (cv[i * 2 + j])
#define max_f(a, b) ((b) < (a) ? (a) : (b))
// #define fff  2
#define mm (fff + 1)
#define fff 2

void AssertWithMessage(const char *exprStr, bool expr, const char *file,
                       int line, const char *msg);
#ifndef NDEBUG
// 有些意思
#define MSG_ASSERT(expr, msg) \
    AssertWithMessage(#expr, expr, __FILE__, __LINE__, msg)
#else
#define MSG_ASSERT(expr, msg) ;
#endif

int main()
{
    double cv[8]{};
    for (int i = 0; i < 4; ++i)
    {
        cv(i, 0) = i;
        // cv()
    }
    for (int i = 0; i < 8; ++i)
        cout << cv[i] << "\t";
    cout << "\n";
    cout << mm << "\n";

    double dd = 12.5;
    string st = to_string(dd);
    st = "-D imax=" + st;

    cout << st << "\n";

    int i = 0, k = 9;
    MSG_ASSERT(i != k, "dfttttttttt");

    cout <<  __FILE__ << "  " << __FUNCTION__ << "  " << __LINE__ << std::endl;
    int m1{3}, m2{8};
    // m2 的的确确加了两边  不要传入带操作的宏
    cout << max_f(++m1, ++m2) << "\n";

    return 0;
}

void AssertWithMessage(const char *exprStr, bool expr, const char *file,
                       int line, const char *msg)
{
    if (!expr)
    {
        cerr << "Assert failed: " << msg << endl;
        cerr << "Condition: " << exprStr << endl;
        cerr << "At: " << file << ":" << line << endl;
        exit(EXIT_FAILURE);
    }
}